\chapter{Problem analysis}

INTRODUCTION HERE 

\section{Binaural hearing}

Binaural hearing determines the individual abilities in sound localization. Since most of all living beings are equipped with two ears, it gives the possibility to capture sounds from two places on the body. A normal human being uses both their ears to capture sound, making it possible to compare the sound in the primary auditory cortex in the brain. Sound localization is determined by different factors, which is either done by using the outer ear and body, or localizing the sound according to the differences in intensity, or \textit{when} the sound arrives.

The location of the sound source can be split into three planes, the median plane, the vertical plane and the horizontal plane.\newline 

%IMAGE \newline 
\begin{figure} [h]
	\begin{center} 
	%	\includegraphics[width=1\textwidth]{./billeder/.png} 
	\end{center}
	\caption{Final concept model for the platform.}
	\label{fig:ID_concept_model}
\end{figure}


\textbf{Sound localization for left, right and ahead} \newline 
The sound signals are compared according to the distance and intensity depending on whether the sound is coming from either the right, left or ahead of us. Sounds coming from other locations, such as behind, are localized by using other factors, for instance the outer ear.

Using the distance for sound localization is known under the term, Interaural time difference(ITD).\newline 

%IMAGE \newline 
\begin{figure} [h]
	\begin{center} 
		\includegraphics[width=0.4\textwidth]{./billeder/ITDimage.png} 
	\end{center}
	\caption{BILLEDTEKST}
	\label{fig:ITD}
\end{figure}

Because of the distance between our ears, the sound will hit the ear closest to the sound source first, and the ear furthest away afterwards. Due to this fact, the distance between our ears will have an effect, when calculating the ITD. The distance between our ears will make it possible to compare the arrival of the sound for each ear, and the delay is known as the Interaural time difference. When the sound is directly in front of the median plane, the sound will arrive at the ears simultaneously. When the sound arrives, it will travel around the head, which creates a small delay. The Interaural time difference can be calculated using the following function, 

\begin{equation}
ITD = \frac{r(\theta + sin\theta)}{c}
\end{equation}

where \textit{r} determines half the distance between the ears measured in meters, \textit{c} is the speed of sound and \ensuremath{\theta} indicates the angle of arrival of the sound from the median plane in radians. This function cannot determine whether the sounds are coming from the back or in front of the specific person, which is done by using other strategies. While utilizing ITD, the ear can measure the phase shift, which is given by the following function, 

\begin{equation}
\Phi_{ITD} = 2\pi \cdot f \cdot r(\theta + sin\theta)
\end{equation}

The auditory system can compare the phases of the sound, and the phase shift will indicate that the sound is arriving earlier or later at the individual ears. \ensuremath{\Phi_{ITD}} is the phase difference between the ears measured in radians.

Another sound localization method is known under the term, Interaural intensity difference (IDD). \newline 

%IMAGE \newline 
\begin{figure} [h]
	\begin{center} 
		\includegraphics[width=0.4\textwidth]{./billeder/IDDimage.png} 
	\end{center}
	\caption{BILLEDTEKST}
	\label{fig:IDD}
\end{figure}

Depending on the frequency of the sound, an acoustic shadow will be created, which is used to localize the sound source. This type of sound localization is better for the higher frequencies, where ITD is better for the lower frequencies. When a high frequency sound arrives at one specific ear, it will create an acoustic shadow behind the opposite ear. The sound in the acoustic shadow is having reduced amplitude, since the head is blocking for the sound waves. The reason IDD is better for higher frequencies than lower frequencies, is because the sound waves will create the acoustic shadow whereas the low frequencies are not attenuated by the head and therefore there will not be created an acoustic shadow. The acoustic shadow is by definition consisting of filtered sound from the blocked sound signals, and is an important feature, when the auditory cortex has to determine the localization.

Binaural hearing is a mix of using both ITD and IDD, and they do in fact cancel each other out in some situations. This effect is known as Interaural Time Difference versus Interaural Intensity Difference trading. When the sound arrives before 673 \ensuremath{\mu}s, the interaural intensity difference will be used. If the delayed sound has a greater amplitude than 12 dB, the direction of the sound will be turned to the delayed sound, which will cancel out this effect of delay versus intensity trading. When the sound arrives later than 673 \ensuremath{\mu}s and between 30 ms, the sound direction is determined by the time difference. This effect is also known as the Haas effect. 

The Haas effect is another kind of ITD and IDD trading effect, also known as the Precedence effect, or Law of the first wave front. 

If the reflections arrive later than 30 ms, two separate sounds are perceived, which can be observed as an echo. This also means, that when the brain has located the sound source once, it is able to focus on that particular sound source even against highly confusing background noise. 

Helmut Haas documented this effect in 1951 in his paper “Über den Einfluss eines Einfachechos auf die Hörsamkeit von Sprache”\cite{haas}. Through experiments he found out that the echo depends on not only the time delay, but also the intensity, direction of the reflection, the characteristics of the original sound and the environment. 

The Haas effect is often used in mixing environments to create wide, open and spacious sound, which results in a realistic sense of depth. The technique is an alternative to panning, which utilizes volume for sound direction identification. Using the Haas effect as a technique can make the directionality of a sound more obvious and realistic. \newline 

\textbf{How front to back ambiguities or the elevation of the sound source can be resolved} \newline 
When the sound comes from behind the receiver, the body structure has a big influence in the sound localization. The outer ear and the body will be used to reflect the sound back to the ear, when sound waves are not directly in the front of the ears. When using the outer ear for sound localization, the pinna will reflect the sound into the ear canal, and according to the delays from the reflections coming from the different directions, the signals will be compared and used for localization of the sound. 

This kind of effect does not work exactly the same way for every person, since all people have different shapes of ears. All people have a unique hearing pattern, which over time can change, for example going from having long hair to getting short hair, since the distance will change around the head. Since hearing patterns are unique, it will give problems when hearing recorded sound, which is recorded for another set of ears. 

It is very natural using the head or the neck for sound localization. When a specific sound is coming from a direction, the head will turn in that direction. When both the ears are getting the sound simultaneously, the sound must be in the median plane.  

\section{Stereophonic listening}

\subsection{Mono and stereo}
\subsection{Binaural stereo}
Binaural stereo is the product of recorded sound representing the human perception of sound. Binaural recording simulates the human hearing using two microphones as a replacement for the ears. When creating binaural stereo, an artificial head is used to simulate the hearing patterns. Using an artificial head results in the sound being filtered before entering the microphones, since the body and the pinnae will reflect the sound differently than recording normal wise. 

Omni-directional microphones can be used for representing the ears, and the distance between the microphones needs to be same length as the distance between the human ears. When simulating the human hearing mechanisms, it is possible for simulating the Interaural Time Difference and the Interaural Intensity Difference. \newline

%INSERT IMAGE \newline 
\begin{figure} [h]
	\begin{center} 
		\includegraphics[width=0.4\textwidth]{./billeder/figure01a.jpg} 
	\end{center}
	\caption{BILLEDTEKST}
	\label{fig:Dummy}
\end{figure}

\section{Human hearing simulation}

The easiest way to emulate the human hearing is to use some sort of surround sound with multiple speakers in a room. However, if this is not possible, it can also be emulated through the headphones. The headphones bypass the effect of the human body that usually would change the characteristics of the sounds. These can be emulated in order to give the user recognizable 

It is the body and shape of the pinnae that changes the charistics of the sound. This means that the sound perception slightly differs from person to person. It is therefore impossible to make a product that emulates three dimensional sounds perfectly; however it is possible to use some kind of average person criteria and thus achieve reasonably accurate sense of direction sounds for the general populace. 

When recording a binaural recording, the result is two response functions, one for each ear that displays, how the sound is supposed to be changed. These functions are called the head related impulse response (HRIR). Head related impulse will however only be capable to emulate the recorded direction. It is therefore necessary to make a recording for every single direction, which would create a vast quantity of numbers. Humans have a spatial resolution, this is the “hearing resolution” being the difference in degrees that a human is able to distinguish that a sound has moved. The spatial resolution is best in front of the head where is is around 3 degrees, the resolution in the back is much lower. Because of the spatial resolution, it is possible to greatly reduce the number of directional recordings.   

From the image (IMAGE REFERENCE) it can be difficult to see what the HRIR actually does. It is a function of time (time domain), in the curve is hidden information of what is to happen to the different frequencies. \newline

INSERT IMAGE 

All functions can be reduced to sinusoids, where each of these represents a frequency. By taking the fourier transform of the HRIR, the function is shifted from time domain to frequency domain, with the following formula: \newline

INSERT EQUATION

The result is two graphs. The first explains which frequencies are to be amplified or reduced. This function is in the frequency domain and disregard the time difference that can occur between the capture of the sound by the ears. This information is saved in the second function that explains, how the phase is going to be changed. 

To get the final sound, two things are needed. The source sound which is to be changed and the HRIR of the direction, that is to be simulated. First the fourier transform is found for both functions, moving the functions from the time domain to the frequency domain. The functions are then convoluted. The result is a frequency domain function that represents the sound as it is supposed to sound through the headphones. Before the sound can be played, the function has to be moved back to the time domain. This is accomplished by the reverse fourier transform.


\section{Room acoustics}
Acoustics in enclosed spaces differ from general acoustics, because the sound will behave differently. This is due to boundaries such as walls and floors that reflects and absorbs the sound thus changes, how the listener will perceive the sound itself, and how the sound will propagate through the room.

The principal characteristics of acoustics in enclosed spaces can, accordingly to the book Acoustics and Psychoacoustics \cite{howard} be narrowed down to three main components. These components are:

\begin{itemize}
\item Direct sound 
\item Early reflctions
\item Reverberant sound
\end{itemize}

\subsection{Direct sound}
The first thing a listener in an enclosed space will perceive is the direct sound. The direct sound is the sound waves that will pass from the source to the receiver in a straight line, thus being the first aspect of the sound perceived. This is also known as the shortest distance between the receiver and the sound source. Since the visual application TCC, does not factor in furnitures, the path between the source of the sound and a potential listener will be seen as unobstructed, therefore only the factors of distance (speed of sound) and air absorption (see later chapter) will be of significance, when designing for the direct sound input. 

The formula for calculating direct sound is, 

\begin{equation}
I_{direct sound} = \frac{QW_{Source}}{4 \pi r^2}
\end{equation} \newline

% \newline 
\begin{figure}[htbp] \centering
\begin{minipage}[b]{0.48\textwidth} \centering
\includegraphics[width=1.00\textwidth]{billeder/directIlld.pdf} % Venstre billede
\end{minipage} \hfill
\begin{minipage}[b]{0.48\textwidth} \centering
\includegraphics[width=1.00\textwidth]{billeder/directcoord.pdf} % Højre billede
\end{minipage} \\ % Captions og labels
\begin{minipage}[t]{0.48\textwidth}
\caption{Venstre figurtekst.} % Venstre caption og label
\label{fig:firectIllu}
\end{minipage} \hfill
\begin{minipage}[t]{0.48\textwidth}
\caption{Højre figurtekst.} % Højre caption og label
\label{fig:directcoord}
\end{minipage}
\end{figure}


\subsection{Early reflections}
The term sound reflection denotes, how a sound wave will reflect upon hitting a surface. According to the law of reflection, which can be used for light, sound and water wave forms, it states: “The reflection of the sound follows the law angle of incidence equals to the angle of reflection.”\cite{raichel} \newline 

%IMAGE \newline 
\begin{figure} [h]
	\begin{center} 
		\includegraphics[width=0.6\textwidth]{./billeder/reflectlaw.pdf} 
	\end{center}
	\caption{BILLEDTEKST}
	\label{fig:reflectlaw}
\end{figure}

Based on this law, it becomes apparent that a portion of the sound wave will reflect back into the initial medium, from where it originates. When dealing with common enclosed spaces, this will be interior air with standard room temperature and humidity.
 

After the initial direct sound, a delayed version, which have bounced off walls, ceilings and floors can be perceived. This is called early reflections and they differ from the direct sound in both time and direction being perceived, due to being reflected around the interior. If the reflections are delayed more than 30 milliseconds, they will be categorized as echoes. As sound waves bounce off one or more surfaces, the message they carry will decrease in clarity, meaning speech will become increasingly hard to understand and changes in music can occur. \newline 

\begin{figure}[htbp] \centering
\begin{minipage}[b]{0.48\textwidth} \centering
\includegraphics[width=1.00\textwidth]{billeder/earlyIllu.pdf} % Venstre billede
\end{minipage} \hfill
\begin{minipage}[b]{0.48\textwidth} \centering
\includegraphics[width=1.00\textwidth]{billeder/earlycoord.pdf} % Højre billede
\end{minipage} \\ % Captions og labels
\begin{minipage}[t]{0.48\textwidth}
\caption{Venstre figurtekst.} % Venstre caption og label
\label{fig:earlyIllu}
\end{minipage} \hfill
\begin{minipage}[t]{0.48\textwidth}
\caption{Højre figurtekst.} % Højre caption og label
\label{fig:earlycoord}
\end{minipage}
\end{figure}

\textbf{Sound absorption in materials} \newline
When the sound wave hits a surface, it was established that a portion will be reflected back into the room. But upon hitting said surface, a portion of the sound wave will also be absorbed by the surface material due to friction and wave energy being converted into vibrations.
 
The amount of absorption varies depending on what material the surface consist of and is denoted as the sound absorption coefficient. The coefficients can be in the range between 0 and 1, with 0 being no absorption and 1 being total absorption. In general, porous materials will absorb wave energy better, because the sound wave is able to penetrate the material, but upon entering the sound will be caught and reflected in the myriad of surfaces and thereby dissipate its energy. Hard surfaces on the other hand, will in general reflect sound waves much more, since they will not trap the sound waves like porous materials.

Formula for absorption in early reflections:
\begin{equation}
Intensity_{reflected} = Intensity_{incident} \times (1 - \alpha)
\end{equation} 

where \ensuremath{Intensity_{reflected}} is the sound intensity reflected after absorption, \ensuremath{Intensity_{incident}} is the sound intensity reflected before absorption and \ensuremath{\alpha} is the absorption coefficient.

\textbf{Absorption coefficients for the main interior of Koldinghus} \newline
For this project, the absorption coefficients will be in the form of painted brick for the walls and sandstone and tiles for the gallery. The main floor was made from marble tiles with the outer surroundings made from brick tiles. The surface of the ceiling of the interior space was made from primarily from plaster. \cite{koldinghus}

To sum up the sound absorption coefficients \cite{abcoef}
\begin{itemize}
\item Painted brick
\item Sandstone 
\item Marble
\item Plaster
\end{itemize}

% INDSÆT TABEL HER
  \begin{tabular}{| l | c | c | c | c | c | c | }
    \hline
    Material & 125 Hz & 250 Hz & 500 Hz & 1000 Hz & 2000 Hz & 4000 Hz\\   \hline

    Brick, Painted & 0,01 & 0,01 & 0,02 & 0,02 & 0,02 & 0,03\\ \hline

    Sandstone & ? & ? & ? & ? & ? & ?\\ \hline

    Marble & 0,01 & 0,01 & 0,01 & 0,01 & 0,02 & 0,02\\ \hline
  
    Plaster & 0,013 & 0,015 & 0,02 & 0,03 & 0,04 & 0,05\\ \hline

  \end{tabular}


\subsection{Reverberant sound}
When sound waves travel through an enclosed space the energy of the sound wave will decay over a period of time due to interactions with surfaces that will result in reflection and absorption. When the sound is at 60 decibels below its initial value, the sound will have died away. The time it takes for a sound at a given time to decay to a level below 60 decibels of the initial value in a room is called the reverberation time. This standard was conceived by Wallace Clement Sabine \citep{rossing}, who also devised the Sabine formula\citep{howard}. The theoretical reverberation time (RT) of a room can be determined using the following formula, if all the surfaces of the room absorb the same fraction of the sound that reaches them, 
\begin{equation}
RT = K \frac{V}{A}
\end{equation} 

where V is the volume of the room, the area of all the surfaces and objects that the sound reaches and K is a contant. As before mentioned, bigger spaces tend to have a longer reverberation time. For instance, a large glass and stone cathedral might have a reverberation time of 10 seconds, while the time might only be 0,2 seconds for a well furnished living room \citep{hoaward}.


\textbf{Sound absorption in air} \newline
Sound absorption does not only happen when a sound wave hits a surface, but also while traveling through a medium, such as the air. This is usually not taken into account in the Sabine formula, because the change for smaller enclosures are often considered insignificant. But for larger enclosures it can be of significance. Air absorption is primarily dependent on two factors; air temperature and humidity. 

The following table shows the air absorption coefficients. 

\textbf{Air absorption per cubic meter:} \\
  \begin{tabular}{| l | c | c | c | }
    \hline
    Air at & 2000 HZ & 4000 Hz & 8000 Hz\\ \hline
    20 C, 30 \% RH & 0,012 & 0,038 & 0,136\\ \hline
    20 C, 50 \% RH & 0,010 & 0,024 & 0,086\\
    \hline
  \end{tabular}

